<%@page import="com.xxb.dao.ProductDao"%>
<%@page import="com.xxb.entity.Product"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	
	String id = request.getParameter("id");
	String tid = request.getParameter("tid");
	String productname = request.getParameter("productname");
	String code = request.getParameter("code");
	String price = request.getParameter("price");
	String mprice = request.getParameter("mprice");
	String color = request.getParameter("color");
	String pic = request.getParameter("pic");
	String content = request.getParameter("content");
	String information = request.getParameter("information");
	String size = request.getParameter("size");
	
	ProductDao dao = new ProductDao();
	
	Product p = dao.findByid(Integer.valueOf(id)); 
	p.setCode(code);
	p.setColor(color);
	p.setContent(content);
	p.setInformation(information);
	p.setMprice(Float.parseFloat(mprice));
	p.setPic(pic);
	p.setProductname(productname);
	p.setPrice(Float.parseFloat(price));
	p.setSize(size);
	p.setTid(Integer.parseInt(tid));
	
	
	int rows = dao.update(p);
	if(rows >  0){
		response.sendRedirect("l_productlist.jsp");
	}
%>